//
//  RBDaylySignRuleVC.m
//  zhongzhenglu
//
//  Created by XL on 2022/8/30.
//

#import "RBDaylySignRuleVC.h"
#import "UIView+RBAdd.h"
#import "UIScrollView+RBAdd.h"
#import <Masonry.h>
#import "RBThemeConfig.h"
#import <UIColor+YYAdd.h>
#import <UIView+YYAdd.h>
#import "RanTool.h"
#import "RBPager.h"
#import "UIViewController+RBAdd.h"
#import "RBRegularWebView.h"

@interface RBDaylySignRuleVC ()

@end

@implementation RBDaylySignRuleVC

#pragma mark - Lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setup];
    [self getData];
}

#pragma mark - Private

- (void)setup
{
    self.title = @"签到规则";
    self.view.backgroundColor = [RBThemeConfig bgGrayColor];
}

- (void)fillDataWithData: (NSDictionary *)dic
{
    [self.view view_addView:({
        UIView *view = UIView.new;
        view.backgroundColor = UIColor.whiteColor;
        [view rbSetCornerRadius:Zoom(5)];
        RBRegularWebView *webView = RBRegularWebView.new;
        webView.preferStyle = @"font-size:13px;line-height:22px;color:#999999;";
        [view view_addView:webView withHeight:30 width:CGFLOAT_MIN top:Zoom(24) bottom:Zoom(24) left:Zoom(17) right:Zoom(17) centerX:NO];
        [webView setHtmlString:dic[@"data"][@"content"]];
        view;
    }) withHeight:CGFLOAT_MIN width:CGFLOAT_MIN top:Zoom(10) bottom:CGFLOAT_MIN left:Zoom(13) right:Zoom(13) centerX:NO];

}

/**
 
 UILabel *view = UILabel.new;
 view.attributedText = [RanTool attributeStringMaker:^(NSMutableArray *maker) {
     [maker addAttributeStringWithFont:[UIFont systemFontOfSize:Zoom(13)] color:[RBThemeConfig textGrayColor] string:@"连续N天签到，N天可后台设置，连续签到成功后可获得虚拟币/优惠券（平台优惠券/店铺优惠券），可分阶段设置连续签到的奖励，如：3天奖励3个虚拟币，7天奖励10个虚拟币，15天30个虚拟币，断签后重新计算连续签到天数" lineSpacing:Zoom(7)];
 }];
 view.numberOfLines = 0;
 view;
 */

#pragma mark - Network

- (void)getData
{
    __weak typeof(self) weak_self = self;
    [self viewLoadDataWithParam:nil path:@"hu_qiandao_guize" post:YES log:YES responseClass:RBResponse.class desView:self.view showHud:YES showPlaceHolder:YES sucBlock:^(RBResponse *data) {
        [weak_self fillDataWithData:data.responseObject];
    } failBlock:^(id data) {
        
    } reloadBlock:^{
        [weak_self getData];
    }];
}

#pragma mark - Event

#pragma mark - Setter

#pragma mark - Getter

@end
